package com.ckr.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @author Shadowckr
 * @create 2021-12-01 18:55
 */
@Component("user")
@Scope("prototype")
// @Component组件等价于<bean id="user" class="com.ckr.pojo.User"/>
public class User {
//    @Value("凯德六号")
    public String name;

    @Value("剑圣")
    // 相当于配置文件中<property name="name" value="剑圣"/>，两种都行
    public void setName(String name) {
        this.name = name;
    }
}
